﻿using Reborn.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MediatR;
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using System.Threading;
using Reborn.MicroKernel.Register;
using Autofac;

namespace Reborn.MicroKernel
{
    public class MicroKernelAPP
    {
        Config _config = null;
        public MicroKernelAPP(Config config) {
            _config = config;
        }
        public void Start()
        {
            if (_config == null) throw new Exception("参数错误");
            if (_config.containerBuilder == null) throw new Exception("请设置容器");

            //注册启动项
            BootstrapRegister.Handler(_config);

            //注册插件   
            PluginsRegister.Handler(_config);

            //注册消息通讯
            MediatorRegister.Handler(_config);

        }
    }
}
